CREATE PROCEDURE sp_ThemLoaiKhach
	@MaLK char(10),
	@TenLK nvarchar(30),
	@HeSo float
AS
BEGIN TRAN
	declare @Ma int
	set @Ma = 1
	while exists (SELECT * FROM LOAIKHACH WHERE ID_LK = @Ma)
		set @Ma = @Ma + 1
	INSERT INTO LOAIKHACH VALUES(@Ma, @MaLK, @TenLK, @HeSo)
	if(@@error <> 0)
		raiserror('Khong the them loai khach',16,1)
COMMIT